<!DOCTYPE html>
<html class="no-js" lang="">

<head>
    #include( "/public-head.html")
</head>

<body style="background-color: #ffffff !important;">
<!-- main area -->
<div class="main-content checkbo">
    <div class="panel mb25">
        <div class="panel-heading border">
                     用户分配角色
        </div>
        <div class="panel-body">
            <div class="row no-margin">
                <div class="col-lg-12">
                    <form action="/vrs/role/distributeRole.jsn" data-url="/vrs/user/list.jsn" id="commentForm" name="ajaxForm" class="form-horizontal bordered-group" role="form">
                        <input name="userId" value="$!{userId}" class="hidden" />
                        <div class="form-group">
                            <label class="col-sm-2 control-label">角色</label>
                            <div class="col-sm-10">
                                <select id="starrSelect"  data-placeholder="请选择角色"  multiple class="chosen" name="roleIds" style="width: 60%;">
                                    #if($roles)
                                    #foreach( $row in $!{roles})
                                    <option value="$!{row.roleId}">$!{row.name}</option>
                                    #end
                                    #end
                                   <!-- #if($ownroles)
	                                    #foreach( $row in $!{roles})
		                                    	#foreach( $row1 in $!{ownroles})
			                                    	#if($row.roleId == $row1.roleId)
			                                    		<option value="$!{row.roleId}" selected="selected">$!{row.name}</option>
			                                    	#else
			                                    		<option value="$!{row.roleId}">$!{row.name}</option>
			                                    	#end
			                                    #end
			                                    	
	                                    #end
                                   	#else
                                   		#foreach( $row2 in $!{roles})
			                                <option value="$!{row2.roleId}">$!{row2.name}</option>
	                                    #end
                                   	#end-->
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label></label>
                            <div>
                                <button type="submit" class="btn btn-primary mr10">保存</button>
                                <button class="btn btn-default">返回</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>


</div>
<!-- /main area -->

#include( "/public-script.html")
#include( "/sub-script.html")
<script>
    initEditSomeSelect('starrSelect','$!{roleId}');
    $("#roleSelect").chosen({
        search_contains:true
    });
</script>
</body>

</html>
